package cn.wolfcode.crm.service.imp;

import cn.wolfcode.crm.domain.SystemLog;
import cn.wolfcode.crm.mapper.SystemLogMapper;
import cn.wolfcode.crm.qo.PageResult;
import cn.wolfcode.crm.qo.QueryObject;
import cn.wolfcode.crm.service.ISystemLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemLogServiceImpl implements ISystemLogService {
    @Autowired
    private SystemLogMapper systemLogMapper;
    @Override
    public void deleteByPrimaryKey() {
        systemLogMapper.deleteByPrimaryKey();
    }

    @Override
    public List<SystemLog> selectAll() {
        return null;
    }

    @Override
    public PageResult queryForList(QueryObject qo) {
        int rows = systemLogMapper.rows(qo);
        if (rows==0) {
            return PageResult.EMPTY_RESULT;
        }
        PageResult result =  new PageResult(rows,systemLogMapper.queryForList(qo));
        return result;

    }
}
